package com.ajk.server.model;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
 * 用户表  <br>
 * t_users <br>
 * v1.0 2016-05-01
 */
 public class Users extends BaseModel{
	
	private static final long serialVersionUID = 1L;
	
 	
 	//id
	private Integer id;

 	//医生,患者,护士,管理员,营养师
 	//role
	private Integer role;

 	//账号,手机号码
 	//mobile
	private String mobile;

 	//密码 MD5
 	//password
	private String password;

 	//名称
 	//name
	private String name;

 	//身高-单位kg
 	//height
	private Double height;

 	//体重-单位cm
 	//weight
	private Double weight;

 	//体重指数BMI=体重(kg)÷身高^2(m)
 	//bmi
	private Double bmi;

 	//年龄
 	//age
	private Date birthday;

 	//性别 1 : 男 2:女
 	//sex
	private Integer sex;

 	//学历
 	//degree
	private String degree;

 	//职业
 	//job
	private String job;

 	//头像
 	//avatar
	private String avatar;

 	//所属区域 dict_region 表ID
 	//region_id
	private Integer regionId;

 	//地址
 	//address
	private String address;

 	//既往史
 	//past_history
	private String pastHistory;

 	//婚姻
 	//matrimony
	private String matrimony;

 	//积分值总和
 	//credits
	private Integer credits;

 	//是否在用,0：未使用,1：正在使用
 	//in_used
	private Integer inUsed;

 	//是否禁用,0：未使用,1：正在使用
 	//is_block
	private Integer isBlock;

 	
 	//last_modify_time
	private Date lastModifyTime;

 	
 	//create_time
	private Date createTime;
	
	private String hobbys;
	
	private String vipcodecard;
	/**
	 * 护士站ID
	 */
	private Integer nursingStationId;
	/**
	 * 二维码
	 */
	private String qrcode;
	/**
	 * 血型
	 */
	private String bloodType;

	List<TreeMenu> menuList;
	
	/**
	*
 	*id
 	*/
	public Integer getId() {
		return id;
	}
	
	/**
	*
 	*id
 	*/
	public void setId(Integer id) {
		this.id = id;
	}
	
	/**
	*医生,患者,护士,管理员,营养师
 	*role
 	*/
	public Integer getRole() {
		return role;
	}
	
	/**
	*医生,患者,护士,管理员,营养师
 	*role
 	*/
	public void setRole(Integer role) {
		this.role = role;
	}
	
	/**
	*账号,手机号码
 	*mobile
 	*/
	public String getMobile() {
		return mobile;
	}
	
	/**
	*账号,手机号码
 	*mobile
 	*/
	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	
	/**
	*密码 MD5
 	*password
 	*/
	public String getPassword() {
		return password;
	}
	
	/**
	*密码 MD5
 	*password
 	*/
	public void setPassword(String password) {
		this.password = password;
	}
	
	/**
	*名称
 	*name
 	*/
	public String getName() {
		return name;
	}
	
	/**
	*名称
 	*name
 	*/
	public void setName(String name) {
		this.name = name;
	}
	
	/**
	*身高-单位kg
 	*height
 	*/
	public Double getHeight() {
		return height;
	}
	
	/**
	*身高-单位kg
 	*height
 	*/
	public void setHeight(Double height) {
		this.height = height;
	}
	
	/**
	*体重-单位cm
 	*weight
 	*/
	public Double getWeight() {
		return weight;
	}
	
	/**
	*体重-单位cm
 	*weight
 	*/
	public void setWeight(Double weight) {
		this.weight = weight;
	}
	
	/**
	*体重指数BMI=体重(kg)÷身高^2(m)
 	*bmi
 	*/
	public Double getBmi() {
		return bmi;
	}
	
	/**
	*体重指数BMI=体重(kg)÷身高^2(m)
 	*bmi
 	*/
	public void setBmi(Double bmi) {
		this.bmi = bmi;
	}
	
	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	/**
	*性别 1 : 男 2:女
 	*sex
 	*/
	public Integer getSex() {
		return sex;
	}
	
	/**
	*性别 1 : 男 2:女
 	*sex
 	*/
	public void setSex(Integer sex) {
		this.sex = sex;
	}
	
	/**
	*学历
 	*degree
 	*/
	public String getDegree() {
		return degree;
	}
	
	/**
	*学历
 	*degree
 	*/
	public void setDegree(String degree) {
		this.degree = degree;
	}
	
	/**
	*职业
 	*job
 	*/
	public String getJob() {
		return job;
	}
	
	/**
	*职业
 	*job
 	*/
	public void setJob(String job) {
		this.job = job;
	}
	
	/**
	*头像
 	*avatar
 	*/
	public String getAvatar() {
		return avatar;
	}
	
	/**
	*头像
 	*avatar
 	*/
	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}
	
	/**
	*所属区域 dict_region 表ID
 	*region_id
 	*/
	public Integer getRegionId() {
		return regionId;
	}
	
	/**
	*所属区域 dict_region 表ID
 	*region_id
 	*/
	public void setRegionId(Integer regionId) {
		this.regionId = regionId;
	}
	
	/**
	*地址
 	*address
 	*/
	public String getAddress() {
		return address;
	}
	
	/**
	*地址
 	*address
 	*/
	public void setAddress(String address) {
		this.address = address;
	}
	
	/**
	*既往史
 	*past_history
 	*/
	public String getPastHistory() {
		return pastHistory;
	}
	
	/**
	*既往史
 	*past_history
 	*/
	public void setPastHistory(String pastHistory) {
		this.pastHistory = pastHistory;
	}
	
	/**
	*婚姻
 	*matrimony
 	*/
	public String getMatrimony() {
		return matrimony;
	}
	
	/**
	*婚姻
 	*matrimony
 	*/
	public void setMatrimony(String matrimony) {
		this.matrimony = matrimony;
	}
	
	/**
	*积分值总和
 	*credits
 	*/
	public Integer getCredits() {
		return credits;
	}
	
	/**
	*积分值总和
 	*credits
 	*/
	public void setCredits(Integer credits) {
		this.credits = credits;
	}
	
	/**
	*是否在用,0：未使用,1：正在使用
 	*in_used
 	*/
	public Integer getInUsed() {
		return inUsed;
	}
	
	/**
	*是否在用,0：未使用,1：正在使用
 	*in_used
 	*/
	public void setInUsed(Integer inUsed) {
		this.inUsed = inUsed;
	}
	
	/**
	*是否禁用,0：未使用,1：正在使用
 	*is_block
 	*/
	public Integer getIsBlock() {
		return isBlock;
	}
	
	/**
	*是否禁用,0：未使用,1：正在使用
 	*is_block
 	*/
	public void setIsBlock(Integer isBlock) {
		this.isBlock = isBlock;
	}
	
	/**
	*
 	*last_modify_time
 	*/
	public Date getLastModifyTime() {
		return lastModifyTime;
	}
	
	/**
	*
 	*last_modify_time
 	*/
	public void setLastModifyTime(Date lastModifyTime) {
		this.lastModifyTime = lastModifyTime;
	}
	
	/**
	*
 	*create_time
 	*/
	public Date getCreateTime() {
		return createTime;
	}
	
	/**
	*
 	*create_time
 	*/
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
	
	public String getHobbys() {
		return hobbys;
	}

	public void setHobbys(String hobbys) {
		this.hobbys = hobbys;
	}

	public List<TreeMenu> getMenuList() {
		return menuList;
	}

	public void setMenuList(List<TreeMenu> menuList) {
		this.menuList = menuList;
	}
	
	public String getVipcodecard() {
		return vipcodecard;
	}

	public void setVipcodecard(String vipcodecard) {
		this.vipcodecard = vipcodecard;
	}

	@Override
	public void dealWith(){
		super.dealWith();
		//体重指数BMI=体重(kg)÷身高^2(m)
		if(weight!=null && weight>0 && height !=null && height>0 ){
			bmi = weight * 10000 / height / height;
			BigDecimal b = new BigDecimal(bmi);
			bmi = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
		}
		
	}

	public Integer getNursingStationId() {
		return nursingStationId;
	}

	public void setNursingStationId(Integer nursingStationId) {
		this.nursingStationId = nursingStationId;
	}

	public String getQrcode() {
		return qrcode;
	}

	public void setQrcode(String qrcode) {
		this.qrcode = qrcode;
	}

	public String getBloodType() {
		return bloodType;
	}

	public void setBloodType(String bloodType) {
		this.bloodType = bloodType;
	}
	
}	